function minimumLength<Type extends { length:number}>(
  obj:Type,
  minmun:number
):Type {
  if(obj.length >= minmun){
    return obj
  }else{
    return { length: minmun }
  }
}

const arr = minimumLength([1,2,3],6)
console.log(arr.slice(0));
